﻿<StatCalc:StatCalcGadgetBase x:Class="EpiDashboard.Gadgets.StatCalc.PoissonGadget"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:EpiDashboard="clr-namespace:EpiDashboard"
    xmlns:StatCalc="clr-namespace:EpiDashboard.Gadgets.StatCalc"
    xmlns:toolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=Epi.DataVisualization.Toolkit"
    xmlns:Controls="clr-namespace:EpiDashboard.Controls"
    Style="{DynamicResource gadgetBaseStyle}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../ResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>        
        <Border Name="borderAll" Style="{DynamicResource mainGadgetBorder}" >

            <Grid x:Name="grdMain">
                <Grid.RowDefinitions>
                    <RowDefinition Height="28"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                
                <Controls:CloseButton x:Name="closeButton" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="5" MouseLeftButtonUp="CloseButton_MouseLeftButtonUp"></Controls:CloseButton>
                
                <StackPanel Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
                    <TextBlock HorizontalAlignment="Center" TextAlignment="Center" FontSize="24" Margin="5" FontWeight="Bold">Poisson - Rare Event vs. Standard</TextBlock>

                    <Grid Height="Auto">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width=".5*" />
                            <ColumnDefinition Width="10" />
                            <ColumnDefinition Width=".5*" />
                            <ColumnDefinition Width="10" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width=".65*"/>
                                <ColumnDefinition Width=".35*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="40"/>
                                <RowDefinition Height="40"/>
                            </Grid.RowDefinitions>
                            <TextBlock VerticalAlignment="Center" Margin="0,0,10,0" Grid.Row="0" Grid.Column="0" TextWrapping="Wrap">Observed # of events:</TextBlock>
                            <TextBox Grid.Row="0" Grid.Column="1" TextAlignment="Right" Height="30" Width="100" HorizontalAlignment="Right" FontFamily="Microsoft Sans Serif"  FontSize="20" x:Name="txtObserved"></TextBox>
                            <TextBlock VerticalAlignment="Center" Margin="0,0,10,0" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap">Expected # of events:</TextBlock>
                            <TextBox Grid.Row="1" Grid.Column="1" TextAlignment="Right" Height="30" Width="100" HorizontalAlignment="Right" FontFamily="Microsoft Sans Serif"  FontSize="20" x:Name="txtExpected"></TextBox>
                        </Grid>
                        <Grid Grid.Column="3" Margin="0,0,10,10"  HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="80" />
                                <ColumnDefinition Width="110" />                                
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="30"/>
                            </Grid.RowDefinitions>
                            
                            <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{DynamicResource gridHeaderCellRectangle}" />                            
                            
                            <Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,0"></Border>

                            <Border Grid.Row="1" Grid.Column="0" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,0,0"></Border>
                            <Border Grid.Row="2" Grid.Column="0" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,0,0"></Border>
                            <Border Grid.Row="3" Grid.Column="0" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,0,0"></Border>
                            <Border Grid.Row="4" Grid.Column="0" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,0,0"></Border>
                            <Border Grid.Row="5" Grid.Column="0" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,0,1"></Border>

                            <Border Grid.Row="1" Grid.Column="1" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,0"></Border>
                            <Border Grid.Row="2" Grid.Column="1" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,0"></Border>
                            <Border Grid.Row="3" Grid.Column="1" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,0"></Border>
                            <Border Grid.Row="4" Grid.Column="1" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,0"></Border>
                            <Border Grid.Row="5" Grid.Column="1" Style="{DynamicResource gridCellBorder}" BorderThickness="1,1,1,1"></Border>


                            <TextBlock x:Name="lblLessThan" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" FontWeight="Bold">&lt;</TextBlock>
                            <TextBlock x:Name="lblLessThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" FontWeight="Bold">&lt;=</TextBlock>
                            <TextBlock x:Name="lblEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="3" FontWeight="Bold">=</TextBlock>
                            <TextBlock x:Name="lblGreaterThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="4" FontWeight="Bold">&gt;=</TextBlock>
                            <TextBlock x:Name="lblGreaterThan" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="5" FontWeight="Bold">&gt;</TextBlock>
                            <!-- -->
                            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.ColumnSpan="2" TextAlignment="Center" Margin="4,2,4,2" TextWrapping="Wrap" Grid.Row="0" FontWeight="Bold" Foreground="White">Probability that the number&#x0a;of events found is</TextBlock>                            
                            <!-- -->
                            <TextBlock Name="txtLessThan" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="1">0</TextBlock>
                            <TextBlock Name="txtLessThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Grid.Row="2">0</TextBlock>
                            <TextBlock Name="txtEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="3">0</TextBlock>
                            <TextBlock Name="txtGreaterThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="4">0</TextBlock>
                            <TextBlock Name="txtGreaterThan" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3" Grid.Row="5">0</TextBlock>
                        </Grid>
                    </Grid>
                </StackPanel>
                
                <StackPanel Grid.Row="7" x:Name="panelMain" HorizontalAlignment="Left" VerticalAlignment="Top"></StackPanel>
                
            </Grid>
        </Border>        
    </Grid>
</StatCalc:StatCalcGadgetBase>
